---
layout: m1x_soap
title: Remove Option
---

<h3><a name="product_attribute.removeOption-Module%3AProductAttributesAPI"></a>Module: Product Attributes API</h3>

<h4><a name="product_attribute.removeOption-Resource%3Aproductattribute"></a>Resource: product_attribute</h4>


<h5><a name="product_attribute.removeOption-Method%3A"></a>Method:</h5>

<ul>
	<li>product_attribute.removeOption (SOAP V1)</li>
	<li>catalogProductAttributeRemoveOption (SOAP V2)</li>
</ul>


<p>Allows you to remove the option for an attribute.</p>

<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId <br class="atl-forced-newline" /> </td>
<td> Session ID </td>
</tr>
<tr>
<td> string </td>
<td> attribute </td>
<td> Attribute code or ID </td>
</tr>
<tr>
<td> string <br class="atl-forced-newline" /> </td>
<td> optionId </td>
<td> Option ID </td>
</tr>
</tbody></table>


<p><b>Return:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Description </th>
</tr>
<tr>
<td> boolean </td>
<td> True if the option is removed </td>
</tr>
</tbody></table>


<p><b>Faults:</b></p>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 101 </td>
<td> Requested attribute not found. </td>
</tr>
<tr>
<td> 104 </td>
<td> Incorrect attribute type. </td>
</tr>
<tr>
<td> 109 </td>
<td> Unable to remove option. </td>
</tr>
</tbody></table>


<h4><a name="product_attribute.removeOption-Examples"></a>Examples</h4>

<h5><a name="product_attribute.removeOption-RequestexampleSOAPV1"></a>Request example SOAP V1</h5>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$attributeCode = "2";
$optionId = 11; // Existing option ID

$result = $proxy-&gt;call(
    $sessionId,
    "product_attribute.removeOption",
    array(
         $attributeCode,
         $optionId
    )
);</pre>
		</div>
</div></div>


<h5><a name="product_attribute.removeOption-RequestexampleSOAPV2"></a>Request example SOAP V2</h5>


<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;catalogProductAttributeRemoveOption($sessionId, '2', '11');
var_dump($result);</pre>
		</div>
</div></div>

				    
Create the Magento文件系统所有者                   			    
